var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = t("Consume"),
s = cc._decorator,
l = s.ccclass,
c = (s.property,
function(t) {
    function e() {
        return null !== t && t.apply(this, arguments) || this
    }
    return n(e, t),
    e.show = function(t) {
        var e = this,
        o = cc.director.getScene();
        if (cc.resources.get("prefab/hint")) {
            var i = cc.instantiate(cc.resources.get("prefab/hint"));
            i.name = "hint",
            i.parent = o,
            i.zIndex = cc.macro.MAX_ZINDEX,
            i.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2, 0),
            i.getChildByName("hint").getChildByName("label").getComponent(cc.Label).string = t,
            this.playAnim(i)
        } else cc.resources.load("prefab/hint", cc.Prefab,
        function(i, n) {
            var a = cc.instantiate(n);
            a.name = "hint",
            a.parent = o,
            a.zIndex = cc.macro.MAX_ZINDEX,
            a.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2, 0),
            a.getChildByName("hint").getChildByName("label").getComponent(cc.Label).string = t,
            e.playAnim(a)
        })
    },
    e.showConsume = function(t, e, o) {
        cc.resources.load("prefab/consume", cc.Prefab,
        function(i, n) {
            var a = cc.instantiate(n);
            a.parent = t.parent,
            a.setPosition(t.getPosition()),
            a.y += 60,
            a.getComponent(r.default).init(e, o)
        })
    },
    e.playAnim = function(t) {
        var e = t.getChildByName("hint");
        e.y = 0,
        cc.tween(e).to(1, {
            y: cc.winSize.height / 2
        }).call(function() {
            t.destroy()
        }).start()
    },
    a([l], e)
} (cc.Component));
o.default = c